#ifndef TRANSACTION_HH
#define TRANSACTION_HH

#include <string>
#include <ctime>
#include "main.hh"

class Transaction {
private:
    std::string transactionId;
    std::time_t timestamp;
    double amount;
    std::string type;
    std::string note;

public:
    Transaction(double amt, const std::string& typ, const std::string& n = "");

    // Getters
    std::string getTransactionId() const;
    std::time_t getTimestamp() const;
    double getAmount() const;
    std::string getType() const;
    std::string getNote() const;

    // Static function to generate transaction ID
    static std::string generateTransactionId();

    // Friend function for output
    friend std::ostream& operator<<(std::ostream& os, const Transaction& t);
};

#endif // TRANSACTION_HH